package oojo.data.spec.sub;

import oojo.data.spec.Create;

/**
 * Create an entity and associate it to a parent.
 */
public class SubCreate<E> extends Create<E> {

    private Object parentId;

    public SubCreate() {}
    
    public SubCreate(E entity) {
        this(null, entity);
    }
    
    public SubCreate(Object parentId, E entity) {
        super(entity);
        setParentId(parentId);
    }
    
    /**
     * The parent to associate with the entity.
     */
    public Object getParentId() {
        return parentId;
    }

    public void setParentId(Object parentId) {
        this.parentId = parentId;
    }
}
